package com.hnhs.model;

import cn.hutool.core.annotation.Alias;
import com.hnhs.enums.ProductStatus;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Product {

    private Integer id;
    private String name;
    private String img;
    @Alias("排序")
    private Integer seq;
    @Alias("父类ID")
    private Integer categoryId;
    private Integer status;
    private double price;
    private String brief;
    @Alias("最近修改人")
    private String lastUpdateBy;
    @Alias("最近更新时间")
    private LocalDateTime lastUpdateTime;
    private String statusX;

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusX() {
        ProductStatus productStatus = ProductStatus.findByCode(this.getStatus());
        if(productStatus == null){
            return "";
        }
        return productStatus.getMsg();

    }
}
